# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=backdoorppt
pkgver=88.d0e7f91
pkgrel=7
pkgdesc='Transform your payload.exe into one fake word doc (.ppt).'
groups=('blackarch' 'blackarch-backdoor')
arch=('any')
url='https://github.com/r00t-3xp10it/backdoorppt'
license=('custom:unknown')
depends=('bash' 'wine' 'zenity' 'xterm' 'ruby')
makedepends=('git')
source=("git+https://github.com/r00t-3xp10it/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  rm README.md

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec ./$pkgname.sh "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

